Skip to content

Conversation

@dustyattenborough
Copy link

@dustyattenborough dustyattenborough commented Jul 23, 2025

data backup 과정에서 정리하기 위해 사용하는 파일들을 업로드 합니다

compare_folders.sh
delete_merged_file.sh
move_Dir2Dir.sh
count_FADC_SADC.sh : run 별로 FADC , SADC 파일이 몇개 있는지 확인
file_integrity_check.sh : 무결성 검사를 위한 파일
PRDfile_presence_check.sh

#!/bin/bash


storedir=/store/cpnr-data/RENE/Data/Data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

대부분 경우 bash에서 변수는 대문자로 적어요.

storedir -> STOREDIR


storedir=/store/cpnr-data/RENE/Data/Data

nPRD=0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nPRD -> NPRD

nPRD=0

#for run in 1000 ;do
for run in {475..2223..1};do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run -> RUN

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 하면 특정 run number에 대해서만 돌 것 같은데 일반화 할 수 있나요?

if [ -f "$file" ]; then
found=1

nPRD=`ls -l $dirname/PRD/* |wc -l`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPRD 변수가 이 loop안에서 바뀌지만 사용되지는 않는 것 같아요. 의도한 건가요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

갯수만 세는 거라면 ls -l 에서 -l 옵션은 빼는 게 좋아요. newline을 붙이는 걸 명시하고 싶다면 -1 (숫자1) 을 넣으세요. -l 을 하게 되면 formatting을 하기 때문에 느려져요.

done

dirname=$storedir/RAW/$run_str
nFADC=`ls -l $dirname/FADC* |wc -l`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ls -l 에서 -l 빼기.

@@ -0,0 +1,45 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파일명 짓는 방식은 동사->명사 식이 읽기 좋아요. check_presence_of_PRDfile.sh 또는 check_PRDfile_presence

#fi

dirname_1=Data/RAW
dirname_2=Data_ssd/RAW
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dirname_1 -> DIRNAME1, dirname_2 -> DIRNAME2 쪽이 나음.

dirname_2=Data_ssd/RAW


for run in {1..2300..1}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

런넘버 기준 일반화 가능한지.

@jhgoh jhgoh added the admin Server administration label Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admin Server administration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants